$(document).ready(function () {
	$('#cancel').css('color', 'red');
	
	tag = location.href.substr(location.href.lastIndexOf('=') + 1);
	
	if(location.href.lastIndexOf('=') != -1) {
		//delete페이지에 맞게 javascript파일을 구성했습니다.
		$('body').on('click', '#delete', function(event) {
			deletedao(event);
			ProfileHandler.showToast("Deleted");
			window.location.href = "main.html";
		});
		$('body').on('click', '#cancel', function(event) {
			window.location.href = "main.html";
		});
	} else {
		$('#title').text("Rollback");
		$('#h1text').text("Return Profile?");
		$('#ptext').text("Return Profile?");
		
		$('body').on('click', '#delete', function(event) {
			ProfileHandler.rollback();
			ProfileHandler.showToast("Restoration Complete");
			window.location.href = "main.html";
		});
		$('body').on('click', '#cancel', function(event) {
			window.location.href = "main.html";
		});
	}
});